import xbmc, xbmcgui
import sys, os, re
import urllib, urllib2

__plugin__ = 'TorrentDisplay'

rootDir = os.getcwd()
if rootDir[-1] == ';':rootDir = rootDir[0:-1]

class Main:
    def __init__(self):
        self.pDialog = None
        self.curr_file = ''
        self.run()


    def run(self):
            import TorrentDisplay
            print '**************start TorrentDisplay.Main() **********'+ str(sys.argv)
            td = TorrentDisplay.Main(sys.argv[ 0 ], sys.argv[1])
            if(td.run()):
                print '**************Replace window ********** '+ sys.argv[ 0 ]
                #xbmc.executebuiltin("ReplaceWindow(video,%s)" % (sys.argv[ 0 ]))
                #xbmc.executebuiltin("Container.Refresh")
            print '**************finished TorrentDisplay.Main() **********'
            #sys.modules.clear()

win = Main()
